<%@ page language="java" import="com.siysoft.tc.base.bean.to.User"
	pageEncoding="UTF-8"%>
<div class="personal-details">
	<div class="onclose">x</div>
	<div class="top">
    	<div class="photo"><c id="friend_detail_avatar"><img src="<%=request.getContextPath()%>/common/images/photo.png"></c></div>
        <div class="text">
        	<p class="p1"><span class="f24"><c id="friend_detail_user_name">HONG YAN</c></span> <c id="friend_detail_grade">GREADE</c></p>
            <p class="p2">University:<c id="friend_detail_school">Kingston</c></p>
        </div>
        
        <div class="praise">
        	<p><span class="glyphicon glyphicon-thumbs-up"></span><span class="n"><c id="friend_detail_user_up">12</c></span></p>
            <p><span class="glyphicon glyphicon-thumbs-down"></span><span class="n"><c id="friend_detail_user_down">8</c></span></p>
        </div>
    </div>
    <div style="height:1px; clear:both"></div>
    <div class="cont">
    	<div class="t">ASSESSMENT LIST</div>
        <ul id="friend_detail_assessment">
        </ul>
        <div class="more">SHOW MORE <span class="glyphicon glyphicon-menu-down"></span></div>
    </div>
</div>

<script>
	function friend_detail(friend_id){
		$.ajax({
			type:"get",
			url:"<%=request.getContextPath()%>/app/user/info.htm",
			data:{
				"id":friend_id,
				"reservation_limit":0,
				"reservation_offset":0,
				"assessment_limit":-1,
				"assessment_offset":-1
			},
			async:false,
			success:function(data){
				u = data.data.user;
				var friend_detail_avatar_html = '<img src="<%=request.getContextPath()%>/' + u.user_avatar + '">';
				$("#friend_detail_avatar").html(friend_detail_avatar_html);
				$("#friend_detail_user_name").html(u.user_name);
				$("#friend_detail_grade").html(u.user_grade);
				$("#friend_detail_school").html(u.user_school);
				$("#friend_detail_user_up").html(u.user_up);
				$("#friend_detail_user_down").html(u.user_down);
				var assessment_html = "";
				for(var i = 0; i < u.user_assessment.length; i++){
					var ass = u.user_assessment[i];
					assessment_html = assessment_html
					+ '<li>'
					+ '<span class="photo"><img src="<%=request.getContextPath()%>/'
					+ ass.assessment_user_avatar + '"></span>'
					+ '<span class="text"><span class="blue">'
					+ ass.assessment_user_name + "</span> Finished the course:"
					+ ass.assessment_content + "</span></li>";
				}
				$("#friend_detail_assessment").html(assessment_html);
			}
		});
		$(".personal-details").show(300);
		$(".filterBg").show();
		$(".filterBg").css({"z-index" : "149"});
	}
</script>